<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>module</title>
</head>
<body>
  
</body>
</html>
<!-- 用模块的方式来加载这个文件 -->
<script type="module" src="./mod1.js"></script>
<script type="module" src="./mod2.js"></script>

<script type="module">
  //使用ES6模块化
  //导入模块里面的数据
  // 一个一个引入的
  import {nickname, work} from './mod1.js'
  console.log(nickname)
  console.log(work())
  

  //默认全部引入
  import * as mod from './mod1.js'
  console.log(mod.nickname)
  console.log(mod.work())

  //默认导出引入
  import mod2 from './mod2.js'
  console.log(mod2.fullname)
  console.log(mod2.hardwork())
</script>